void main() {
  Man zs = Man('zs', 18);
  Woman ls = Woman('ls', 19);

  zs.eat();
  ls.eat();

}

class Person {
  Person(this.name, this.age);

  String? name;
  int? age;

  void eat() {
    print('$name -- eat');
  }
}


/// 男人类
class Man extends  Person {
  // 子类调用父类的构造 函数
  Man(super.name, super.age);

  @override
  eat(){
    print('$name爱吃肉');
  }
}

/// 女人类
class Woman extends Person {
 Woman(super.name, super.age);

  @override
  eat(){
    print('$name爱吃 青菜 ');
  }
}
